package nl.ceasaro.jeslee.core.model.clothes;

import nl.ceasaro.jeslee.core.model.AbstractEntity;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * Created by IntelliJ IDEA.
 * User: cees
 * Date: Oct 4, 2008
 * Time: 7:16:06 PM
 * <p>
 * Represents a model showing a dress
 * </p>
 */
public class Design extends AbstractEntity
{
   private static final long serialVersionUID = 1979724272586268878L;

   private String name;

   public String getName()
   {
      return name;
   }

   public void setName(String name)
   {
      this.name = name;
   }

   @Override
   public String toString()
   {
      ToStringBuilder toStringBuilder = new ToStringBuilder(this);
      toStringBuilder.append(getName());
      return toStringBuilder.toString();
   }

   @Override
   public boolean equals(Object obj)
   {
      if (this == obj)
      {
         return true;
      }
      if (!(obj instanceof Design))
      {
         return false;
      }

      Design design = (Design) obj;

      if (!getName().equals(design.getName()))
      {
         return false;
      }

      return true;
   }

   @Override
   public int hashCode()
   {
      return getName().hashCode();
   }

}
